package webprog;

import java.util.Comparator;

import de.fhwgt.quiz.application.Player;
/**
 * 
 * @author Gennadi Heimann
 * Klasse stellt die Parameter um Highscore zu sortieren
 *
 */
public class PlayerComperator implements Comparator<Player>{

	@Override
	public int compare(Player o1, Player o2) { 
		return (int) (o2.getScore() - o1.getScore());
	}  
	 
	
//	public int compare(Player o1, Player o2) {
//		if(o1.getScore() > o2.getScore()){
//			return -1;
//		}else{
//			if(o1.getScore() == o1.getScore()){
//				return 0;
//			}else{
//				return 1;
//			}
//		}
////		return o1.getScore().compareTo(o2.getScore());
//	}
}
